package com.nsoft.html5npub.objects;

import com.nsoft.html5npub.utils.Constant;

public class Settings {
	public static String VERTICAL_LIST="vertical list";
	public static String GRID_LIST="grid list";
	
	public static enum InterfaceType{
		VerticalList,
		GridList,
	}
	private static InterfaceType interfaceType; 
	
	private static String serverName=Constant.EMPTY;
	private static String appName=Constant.EMPTY;
	private static String downloadUrl=Constant.EMPTY;
	private static boolean isUseAppId=Boolean.FALSE;
	private static String appId=Constant.EMPTY;
	private static String iconUrl=Constant.EMPTY;
	private static boolean isVibrationOn=Boolean.TRUE;
	
	public static InterfaceType getInterfaceType() {
		return interfaceType;
	}
	public static String getInterfaceTypeByString(){
		if (interfaceType==InterfaceType.VerticalList){
			return VERTICAL_LIST;
		}else if (interfaceType==InterfaceType.GridList){
			return GRID_LIST;
		}
		return Constant.EMPTY;
	}
	public static void setInterfaceType(
				InterfaceType interfaceType) {
		Settings.interfaceType=interfaceType;
	}
	public static void setInterfaceType(
				String interfaceType){
		if (interfaceType.equals(VERTICAL_LIST)){
			Settings.interfaceType=
					InterfaceType.VerticalList;
		}else if (interfaceType.equals(GRID_LIST)){
			Settings.interfaceType=
					InterfaceType.GridList;
		}
	}
	
	public static String getServerName() {
		return serverName;
	}
	public static void setServerName(String _serverName) {
		serverName = _serverName;
	}
	
	public static String getAppName() {
		/**
		if (appName.equals(Constant.EMPTY))
			return Constant.UTIL_SERVER_APPLICATION;
		*/
		return appName;
	}
	public static void setAppName(String _appName) {
		appName = _appName;
	}
	
	public static String getDownloadUrl() {
		/**
		if (downloadUrl.equals(Constant.EMPTY))
			return Constant.dataserver.
						SERVER_BOOKLIST_PARAMS;
		*/
		return downloadUrl;
	}
	public static void setDownloadUrl(
					String _downloadUrl) {
		downloadUrl = _downloadUrl;
	}
	
	public static boolean isUseAppId() {
		return isUseAppId;
	}
	public static void setUseAppId(boolean isUseAppId) {
		Settings.isUseAppId = isUseAppId;
	}
	
	public static String getAppId() {
		return appId;
	}
	public static void setAppId(String appId) {
		Settings.appId = appId;
	}
	
	public static String getIconUrl() {
		/**
		if (iconUrl.equals(Constant.EMPTY))
			return Constant.dataserver.
						SERVER_ICONLIST_PARAMS;
		*/	
		return iconUrl;
	}
	public static void setIconUrl(String _iconUrl) {
		iconUrl = _iconUrl;
	}
	
	public static boolean isVibrationOn() {
		return isVibrationOn;
	}
	public static void setVibrationOn(boolean isVibrationOn) {
		Settings.isVibrationOn = isVibrationOn;
	}
}
